#include<bits/stdc++.h>
using namespace std;

int main() {
	int t;
	cin >> t;
	while(t -- ) {
		int n;
		cin >> n;
		string s;
		cin >> s;
		int ret = 0;
		for(int i = 0; i < n; i ++ ) {
			if(s[i] == '1') {
				ret ++ ;
			}
		}
		cout << ret << endl;
		for(int i = 0; i < n; i ++ ) {
			if(s[i] == '1') {
				cout << i + 1 << " " << i + 1 << endl;
			}
		}
	}
	return 0;
}

